package com.cy.zs.hp.feign.controller;



import com.cy.zs.hp.common.jsonResult.JsonResult;
import com.cy.zs.hp.model.HisPatient;
import com.cy.zs.hp.model.HisRegister;
import com.cy.zs.hp.model.SchedulingTable;
import com.cy.zs.hp.service.IHisUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;


@RestController
public class FeignController {
    @Autowired
    private IHisUserService iHisUserService;


    @RequestMapping("/hp/schedulingTable/doFindByDoctorId")
    public JsonResult doFindByDoctorId(Integer id) {
        List<SchedulingTable> times = iHisUserService.findWorkTableByDoctorId(id);
        return new JsonResult(times);
    }
    @RequestMapping("/hp/hisPatient/doAddPatient")
    public JsonResult doAddPatient(@Valid HisPatient hisPatient){
        List<HisPatient> list = iHisUserService.addPatient(hisPatient);
        return new JsonResult(list);
    }
    @RequestMapping("/hp/hisRegister/doAddRegister")
    public JsonResult doAddRegister(@Valid HisRegister hisRegister){
        Integer i = iHisUserService.addRegister(hisRegister);//添加预约挂号登记表
        return new JsonResult("预约完成");
    }
}